fix(divan): bump proc-macro-crate to parse multiline inline tables#185
Conversation
The bench macro resolves the renamed `codspeed-divan-compat` dependency via `proc_macro_crate::crate_name`, which parses the consumer's Cargo.toml with toml_edit. proc-macro-crate 3.2.0 pulled toml_edit 0.22, which parses in strict TOML 1.0 mode and rejects multiline inline tables. When a manifest contained one (e.g. a formatter-wrapped `features = [...]` list), parsing failed, the rename could not be resolved, and the macro fell back to the unrenamed `codspeed_divan_compat` path, producing `E0433: cannot find codspeed_divan_compat in the crate root`. Bump to proc-macro-crate 3.5.0, which depends on toml_edit 0.25 with TOML 1.1 support, so multiline inline tables parse and the rename resolves correctly. Raise the crate MSRV to 1.85 to match the rest of the workspace (proc-macro-crate 3.5.0 requires 1.82). Closes COD-3022 Co-Authored-By: Claude <noreply@anthropic.com>
Greptile SummaryThis PR updates the Divan compatibility macro dependency used to resolve renamed crates.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(divan): bump proc-macro-crate to par..." | Re-trigger Greptile |
Merging this PR will not alter performance
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | iterative[0] |
1 ns | 9 ns | -88.89% |
| ❌ | WallTime | init_array[42] |
37 ns | 62 ns | -40.32% |
| ❌ | Simulation | iterative[0] |
119.2 ns | 148.3 ns | -19.66% |
| ❌ | WallTime | hamiltonian_cycle[7] |
1 µs | 1.3 µs | -17.39% |
| ❌ | WallTime | iter_with_setup |
48 ns | 52 ns | -7.69% |
| ❌ | WallTime | bench_array1[42] |
36 ns | 38 ns | -5.26% |
| ⚡ | WallTime | instant |
23 ns | 12 ns | +91.67% |
| ⚡ | WallTime | string_processing_multi_counter |
682 ns | 384 ns | +77.6% |
| ⚡ | WallTime | count_set_bits[0] |
10 ns | 7 ns | +42.86% |
| ⚡ | Simulation | count_set_bits[0] |
119.2 ns | 90 ns | +32.41% |
| ⚡ | Simulation | count_set_bits[1024] |
121.1 ns | 91.9 ns | +31.72% |
| ⚡ | Simulation | count_set_bits[42] |
123.9 ns | 94.7 ns | +30.79% |
| ⚡ | Simulation | count_set_bits[255] |
130.8 ns | 101.7 ns | +28.69% |
| ⚡ | Simulation | count_set_bits[65535] |
141.9 ns | 112.8 ns | +25.86% |
| ⚡ | WallTime | add_two_integers[(255, 255)] |
21 ns | 19 ns | +10.53% |
| ⚡ | WallTime | add_two_integers[(42, 13)] |
20 ns | 19 ns | +5.26% |
| ⚡ | Simulation | string_copy_with_bytes_counter |
915.6 ns | 886.4 ns | +3.29% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing cod-3022-codspeed-macro-fails-to-parse-multiline-inline-table-in (9229680) with main (9339a52)
Bump
proc-macro-cratefrom 3.2.0 to 3.5.0 in the divan compat macros crate so that the bench macro can parse consumer manifests that use multiline inline tables.The
divan::benchmacro resolves the (often renamed)codspeed-divan-compatdependency by callingproc_macro_crate::crate_name, which parses the consumer'sCargo.tomlwithtoml_edit.proc-macro-crate3.2.0 pulledtoml_edit0.22, which parses in strict TOML 1.0 mode and rejects multiline inline tables — a TOML 1.1 feature that Cargo itself accepts. When a manifest contained one (e.g. a longfeatures = [...]list wrapped across lines by a formatter), parsing failed, the rename could not be resolved, and the macro silently fell back to the unrenamedcodspeed_divan_compatpath, producing:proc-macro-crate3.5.0 depends ontoml_edit0.25 (+spec-1.1.0), which parses multiline inline tables, so the rename resolves correctly.This surfaced from a real user report (biome): after a CI formatter rewrapped a dependency in
biome_module_graph/Cargo.tomlinto a multiline inline table, their divan benchmarks stopped compiling. Reproduced the exactE0433withproc-macro-crate3.2.0 /toml_edit0.22 against that manifest shape, and confirmed it compiles cleanly with 3.5.0 /toml_edit0.25.The crate's MSRV is raised 1.80 → 1.85 to match the rest of the workspace (
proc-macro-crate3.5.0 requires 1.82, and the parentcodspeed-divan-compatlib is already 1.85, so this is not a consumer-facing bump). The CImsrv-checkjob fordivan_compatpasses at 1.85.Closes COD-3022